parts = ['头部', '颈部', '胸部', '腹部', '腰部', '背部', '骨盆区', '生殖部位', '四肢', '皮肤', '骨骼肌肉', '血液', '全身']
parts_data = dict(zip(parts,[[]for i in parts]))
parts_data['其它']=[]
for line in open('../file/中国医药信息查询平台/parts.txt',encoding="utf8"):
    line =[i for i in line.replace("\n",'').split("\t") if i!='']
    dis = line[0]
    if line[1:]:
        status = ''
        for element in line[1:]:
            if element in parts:
                status=element
        if status=='':
            status='其它'
            parts_data[status].append(dis)
        else:
            parts_data[status].append(dis)
f =open('we.txt','w',encoding="utf8")
for element,value  in parts_data.items():
    f.write("<dt>"+element+"</dt>"+'\n')
    for key in value:
        f.write('<dd><a href="/index?type=疾病名称&name='+key+'">'+key+'</a></dd>'+'\n')
    f.write("\n\n\n")
import urllib.parse

str = "http://127.0.0.1:8020/index?type=%E7%96%BE%E7%97%85%E5%90%8D%E7%A7%B0&name=%E8%BF%87%E6%95%8F%E6%80%A7%E9%BC%BB%E7%82%8E"

print(urllib.parse.unquote(str, encoding="utf8"))